from sqlalchemy import Column, Integer, String, Text, DateTime, Numeric, SmallInteger
from sqlalchemy.sql import func
from ..core.database import Base

class Store(Base):
    __tablename__ = "stores"
    
    id = Column(Integer, primary_key=True, index=True)
    name = Column(String(200), nullable=False)
    description = Column(Text)
    address = Column(Text)
    phone = Column(String(20))
    business_hours = Column(String(100))
    latitude = Column(Numeric(10, 8))
    longitude = Column(Numeric(11, 8))
    logo_url = Column(Text)
    status = Column(SmallInteger, default=1)  # 1:正常 0:停业
    created_at = Column(DateTime(timezone=True), server_default=func.now()) 